package com.jqr.activity.myroomcart.dao;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

import com.jqr.activity.myroomcart.models.BookInfo;

import java.util.List;

@Dao
public interface BookDao {
    @Insert
    void  insert(BookInfo... bookInfos);
   @Delete
    void  delete(BookInfo... bookInfos);

    @Update
    int update (BookInfo... bookInfos);
    @Query("select * from bookinfo")
    List<BookInfo> queryAll();
    @Query("select * from bookinfo where name like '%'|| :name || '%'")
    List<BookInfo> queryByName(String name);
    @Query("delete from bookinfo")
    void deleteAll();
}
